package com.qianli.cashmama.trade.common.enums;

/**
 * Created with IntelliJ IDEA.
 * User: sm
 * Date: 2017/7/22
 * Time: 上午10:31
 */
public enum TradeAuditStatusEnum {
    INIT(0, "初始化"),
    AUDIT_SUCCESS(1, "成功"),
    AUDIT_FAILED(2, "失败");

    private int status;
    private String desc;

    TradeAuditStatusEnum(int status, String desc) {
        this.status = status;
        this.desc = desc;
    }

    public int getStatus() {
        return status;
    }

    public TradeAuditStatusEnum setStatus(int status) {
        this.status = status;
        return this;
    }

    public String getDesc() {
        return desc;
    }

    public TradeAuditStatusEnum setDesc(String desc) {
        this.desc = desc;
        return this;
    }

    public static TradeAuditStatusEnum covertByStatus(int status) {
        TradeAuditStatusEnum tradeAuditStatusEnum = null;
        for (TradeAuditStatusEnum auditStatusEnum : TradeAuditStatusEnum.values()) {
            if (auditStatusEnum.getStatus() == status) {
                tradeAuditStatusEnum = auditStatusEnum;
                break;
            }
        }
        return tradeAuditStatusEnum;
    }
}
